Skip to content

Scribble assignment#116

Open
lokesh-ctrl wants to merge 17 commits into
everest-engineering:mainfrom
lokesh-ctrl:assignment
Open

Scribble assignment#116
lokesh-ctrl wants to merge 17 commits into
everest-engineering:mainfrom
lokesh-ctrl:assignment

Conversation

@lokesh-ctrl

@lokesh-ctrl lokesh-ctrl commented Jun 9, 2026

Copy link
Copy Markdown

Summary

Full implementation of all four business scenarios from the Scribble lab, built incrementally with Spec Kit artifacts for each feature group:

  • Scenario 1 — Room Setup & Lobby: host tracking on room creation, join validation with error feedback, automatic lobby polling (~2 s), host-only start with 2-player minimum, multi-room isolation.
  • Scenario 2 — Game Start & Drawer Flow: player name trimming/validation, drawer assignment (host becomes drawer), deterministic secret word selection, word visible only to the drawer.
  • Scenario 3 — Gameplay Interaction: interactive HTML5 drawing canvas with clear action (drawer only), guess submission with trim + case-insensitive comparison, guess history synced to all players via polling, correct guess scores 100 pts.
  • Scenario 4 — Result, Restart & Final Validation: room transitions to completed on correct guess, secret word revealed to all players, ResultsPage shows correct word + full guess history + scores; host-only Restart returns everyone to the lobby with players and cumulative scores preserved and all round state cleared.

Each scenario has a full Spec Kit artifact set: spec.md, plan.md, research.md, data-model.md, contracts/api.md, quickstart.md, and tasks.md under specs/00N-*/.

Contributor

- Fix API base URL bug (/bug -> /api)
- Add hostId to Room/RoomSnapshot; extend RoomStatus to active|completed
- Enforce name validation (trim + min 1) via Zod; return 422 with message
- Case-insensitive room code lookup on join
- POST /api/rooms/:code/start with host+player-count gating
- Lobby auto-polls every 2s; all players auto-navigate on status=active
- Host badge in participant list; Start button host-only, disabled <2 players
- Client-side validation with aria-describedby for accessibility
…game screen

- Add drawerId + secretWord fields to Room and RoomSnapshot models
- startGame sets drawerId=hostId and secretWord=STARTER_WORDS[0] (deterministic)
- toRoomSnapshot gates secretWord: only returned when viewer is the drawer
- GamePage shows role badge (Drawer/Guesser), word card for drawer, Drawing/Guessing labels
- GamePage polls every 2s to keep game state fresh
- 4 new backend unit tests covering null init, assignment, snapshot gating, determinism
@lokesh-ctrl lokesh-ctrl changed the title feat: all 4 scenarios — room setup, game start, gameplay, and result/restart Scribble assignment Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant